|
|
|
|
|
|
|
Setting the Startup Project |
|
|
|
|
|
|
|
|
Now that you have drawn an instance of your control on the form, you can start the test project. When you are using a project group, you must first specify which project is the startup project. Visual Basic gives that project the focus, starting the other projects automatically. Because the ActiveX control is designed to be used within another project, you need to set the startup project to be the test project, Project1. To do so, right-click Project1 in the Project Explorer window, and select Set as Start Up from the context menu that appears, as shown in Figure 14.6. The Project1 project should change to boldface to indicate that it is the startup project. |
|
|
|
|
|
|
|
|
Figure 14.6
Set the startup project to be the
test Standard EXE project. The
ActiveX project starts automatically. |
|
|
|
|
|
|
|
|
To start the test project, press F5 or click Visual Basic's Start button. The form should load, and the text boxes on the Address control become active. |
|
|
|
|
|
|
|
|
Enter some text in each field. Next, press Ctrl+Break to put the project in Break mode. Open the Immediate window by pressing Ctrl+G, and print the value of the AddressText property by entering the following statement: |
|
|
|
|
|
|
|
|
Print AddressCtl1.AddressText |
|
|
|
|
|
|
|
|
If you see a list of the values you entered in the control, then the control is working properly. Notice also that as you enter the Print command, Visual Basic displays all the properties of your control in a pop-up list, and the AddressText property is included. |
|
|
|
|
|
|
|
|
If you cannot print the value of the AddressText property successfully, make sure that the code in the Property Get procedure is entered correctly. If you want to learn more about debugging a program, see Chapter 10, "Controlling the Flow of Your Program Code." You can use the methods described there to step through the code in the AddressText property procedure, examining the contents of the variables to verify that they are correct. |
|
|
|
|
|
|
|
|
See ''Debugging Your Programs," p. 214 |
|
|
|
|
|
|
|
|
Testing with Internet Explorer |
|
|
|
|
|
|
|
|
You have just seen how to use the Address control in a Visual Basic project group. As you already know, a compiled ActiveX control can be used in Internet Explorer on a Web page. However, in previous versions of Visual Basic, testing with Internet Explorer was difficult; you |
|
|
|
|
|